package com.thenie.chat.util;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 * @Description 校验工具类
 * @Author thenie
 * @Data 2022/5/19 10:46
 */
public class ValidatorUtil {
    //邮箱格式校验规则
    public static final Pattern email_pattern =Pattern.compile("[a-zA-Z0-9]+@[a-zA-Z0-9]+\\.[a-zA-Z0-9]+");

    /**
     * 判断邮箱格式是否正确
     * @param email
     * @return
     */
    public static boolean isEmail(String email){
        Matcher matcher = email_pattern.matcher(email);
        return matcher.matches();
    }
}
